namespace OasisCiq.Xal
{
    using System;
    using System.Linq;
    using XS;

    /// <summary>
    /// A list of administrative area types
    /// </summary>
    public class AdministrativeAreaTypeList : XSNormalizedString
    {
        private static readonly string[] PossibleValues = new[]
        {
            "City", // Only name of the administrative area without its type, e.g. NSW, CA, Quebec
            "State", // The type of the area, e.g. state, district, province, etc.
            "Territory",
            "Province"
        };

        public AdministrativeAreaTypeList(string value)
            : base(value)
        {
            if (!PossibleValues.Contains(value))
            {
                throw new ArgumentOutOfRangeException();
            }
        }
    }
}